home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / syncrnet / oneline1.zip / ONELINER.SRC < prev    next >
Text File  |  1996-04-21  |  8KB  |  290 lines

  1. # ┌──────────────────────────────────────────────────────────────────────────┐
  2. # │      ONELINER.SRC   (Chuckle Box One-Liners)                             │
  3. # │                                                                          │
  4. # │          Version:   1.0  (Released 21 Apr 1996) for SBBS 2.20 - Rev B    │
  5. # │           Author:   Robert Nykvist  aka  Chuckles@LAUGHBOX               │
  6. # │      Support BBS:   The Chuckle Box BBS  (334) 653-1888                  │
  7. # │                                                                          │
  8. # │      Quick Start:   1.  Move ONELINER.SRC to your \EXEC directory.       │
  9. # │                     2.  Edit paths in script as needed for your system.  │
  10. # │                     3.  Compile ONELINER.SRC with Baja compiler.         │
  11. # │                     4.  Make script available to your callers.           │
  12. # │                                                                          │
  13. # │             NOTE:       This script uses file I/O commands to create     │
  14. # │                         and append to One-Liner file.  Check the paths!  │
  15. # │                         It also awards users with credits for posting.   │
  16. # └──────────────────────────────────────────────────────────────────────────┘
  17. !INCLUDE SBBSDEFS.INC
  18. !INCLUDE FILE_IO.INC
  19.  
  20. # Top of Generic Menu.
  21. :top
  22. CMD_HOME
  23. cls
  24. crlf
  25. crlf
  26. crlf
  27. crlf
  28. crlf
  29. print "nh¥7█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀k▄0"
  30. crlf
  31. print "¥w7█ nk7┌─────────────hw┐ k█0"
  32. crlf
  33. print "¥w7█ nk7│  OneLiners  hw│ k█0"
  34. crlf
  35. print "¥w7█ nk7│ r─────────── hw│ k█0"
  36. crlf
  37. print "¥w7█ nk7│    hyVnb7iew     hw│ k█0"
  38. crlf
  39. print "¥w7█ nk7│    hyAnb7dd      hw│ k█0"
  40. crlf
  41. compare_ars SYSOP
  42.   if_true
  43.     print "¥w7█ nk7│    hyEnb7dit     hw│ k█0"
  44.     crlf
  45.   end_if
  46. print "¥w7█ nk7│    hyQnb7uit     hw│ k█0"
  47. crlf
  48. print "¥w7█ nk7└hw─────────────┘ k█0"
  49. crlf
  50. print "¥w7▀k▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█0n"
  51. crlf
  52. crlf
  53. crlf
  54. crlf
  55. crlf
  56.  
  57. # Give SysOp Prompt for his Extra EDIT command.
  58. compare_ars SYSOP
  59.   if_true
  60.     print "wh                              Enter (yVw/yAw/yEw/yQw) : n"
  61.   else
  62.     print "wh                               Enter (yVw/yAw/yQw) : n"
  63.   end_if
  64.  
  65. # Get User Input : View, Add or Quit (Cmd-E only works for SysOp)
  66. node_action node_xtrn
  67. sync
  68. getcmd AEQV?
  69.  
  70. # Redisplay Menu
  71. cmdkey ?
  72.   cmd_pop
  73.   goto top
  74. end_cmd
  75.  
  76. # Add a One-Liner.  Goto WRITE
  77. cmdkey A
  78.   cmd_pop
  79.   goto write
  80. end_cmd
  81.  
  82. # Edit Option for SysOp.  Paths Uses "cstr" string (double slashes).
  83. cmdkey E
  84.   compare_ars SYSOP
  85.     if_true
  86.       crlf
  87. # ┌──────────────────────────────────────┐
  88. # │ P A T H   C H E C K   W A R N I N G  │
  89. # └──────────────────────────────────────┘
  90.       setstr "d:\\xtrn\\liners\\oneline.dab"
  91.       ungetstr
  92.       edit_text_file
  93.     end_if
  94.   cmd_pop
  95.   goto top
  96. end_cmd
  97.  
  98. # Quit Script.  Goto BYEBYE
  99. cmdkey Q
  100.   cmd_pop
  101.   goto byebye
  102. end_cmd
  103.  
  104. # View One-Liners.  Customize your own header Info.
  105. cmdkey V
  106. :View
  107.   cls
  108.   crlf
  109.   print "                           nrChhyuwckle Box One-Linyerrnrs"
  110.   crlf
  111.   print "hw──────────────────────────────────────────────────────────────────────────────n"
  112. # ┌──────────────────────────────────────┐
  113. # │ P A T H   C H E C K   W A R N I N G  │
  114. # └──────────────────────────────────────┘
  115. # Checking to see if file is there.  If so, print most recent 16 lines.
  116.    chkfile "d:\xtrn\liners\oneline.dab"
  117.     if_true
  118.       setstr "d:\\xtrn\\liners\\oneline.dab"
  119. # P_NOATCODES disables expansion of SYSTEM variables like @USER@
  120. # Replace the below P_NOATCODES with 0 to have some variable fun.  <Chuckle>
  121. # e.g. :  All are invited to @USER@'s house for a wild party...
  122.       printtail str P_NOATCODES 16
  123.     else
  124.       crlf
  125.       print "yh        No one has written yet, or the SysOp has screwed up somewhere."
  126.       crlf
  127.     end_if
  128.   print "hw──────────────────────────────────────────────────────────────────────────────n"
  129.   crlf
  130.   pause
  131.   cmd_pop
  132. goto top
  133. end_cmd
  134.  
  135. # Add One-Liner
  136. :Write
  137. cls
  138. crlf
  139. crlf
  140.  
  141. # Define One-Liner String Variable.  Send them Prompt Info.
  142. str one
  143. print "rhWrite something fun now. y (w1nc-Linehy) nm Press ENTER when done."
  144. crlf
  145. crlf
  146. print "hy > "
  147.  
  148. # Get user input - Variable ONE.
  149. sync
  150. getstr one 70 K_LINE|K_NOEXASC|K_MSG
  151.  
  152. # If NULL input, take them back to the Top of the Menu.
  153. compare one ""
  154.   if_true
  155.     cmd_pop
  156.     goto top
  157.   end_if
  158.  
  159. # Otherwise, Let them see what they have done.  Display it.
  160. :displayit
  161.  crlf
  162.  print "rh─────────────────────────────────────────────────────────────────────────────hw"
  163.  crlf
  164.  print "n■ hy"
  165.  print one
  166.  crlf
  167. print "rh─────────────────────────────────────────────────────────────────────────────n"
  168. crlf
  169. crlf
  170.  
  171. # Double check to see if they want to post it or not.
  172. print "rhIs this OK to post? y (wYn/hwNy) > n"
  173. sync
  174. getcmd YN
  175.  
  176. # Post  One-Liner
  177. cmdkey Y
  178.  
  179. # This area blocked off.  If you have SmegBEEP and wish to censor input
  180. # Unblock/Edit the below code and recompile.
  181. # copy str one
  182. # exec_bin smegbeep
  183. # compare str "Censored"
  184. #   if_true
  185. #     crlf
  186. #     print "rhNasty A$$ Word Detected - wPost Aborted..."
  187. #     crlf
  188. #     crlf
  189. #     pause
  190. #     cmd_pop
  191. #     goto top
  192. #   end_if
  193.  
  194. # Adding random color variety to the one-liners using RANDOM & COMPARE.
  195. # Can be over-ridden by use of Ctrl_A codes allowed in getstr input.
  196. # Define Random Variable & String
  197.   int number
  198.   str two
  199.   random number 7
  200.   compare number 0
  201.     if_true
  202.       set two "n■ hm"
  203.     end_if
  204.   compare number 1
  205.     if_true
  206.       set two "n■ hg"
  207.     end_if
  208.   compare number 2
  209.     if_true
  210.       set two "n■ hw"
  211.     end_if
  212.   compare number 3
  213.     if_true
  214.       set two "n■ hr"
  215.     end_if
  216.   compare number 4
  217.     if_true
  218.       set two "n■ hc"
  219.     end_if
  220.   compare number 5
  221.     if_true
  222.       set two "n■ hy"
  223.     end_if
  224.   compare number 6
  225.     if_true
  226.       set two "n■ hb"
  227.     end_if
  228.  
  229. # Define File Variable
  230.   int file
  231.  
  232. # Appending user input to end of ONELINE.DAB file.
  233. # Open File.  If non-existant, create it.
  234. # ┌──────────────────────────────────────┐
  235. # │ P A T H   C H E C K   W A R N I N G  │
  236. # └──────────────────────────────────────┘
  237.   fopen file O_CREAT|O_WRONLY|O_APPEND "d:\xtrn\liners\oneline.dab"
  238.  
  239. # Print Random Ctrl-A Color (Variable TWO from above)
  240.     fprintf file "%s" two
  241.  
  242. # Print User Input to file, and end with Ctrl-A code "(" - It hides text.
  243.     fprintf file "%sn( [" one
  244.  
  245. # User number is hidden from users with less than 90 security level.
  246. # You can change that level.  See page 244, 8/95 -SysOp Manual
  247. # After printing user Number, restore display ")" and add return.
  248.     copy str _USERON.NUMBER
  249.     fprintf file "%s])\r\n" str
  250.  
  251. # Close the lid and flush.  <Chuckle>
  252.   fclose file
  253.  
  254. # Alert SysOp of One-Liner Post so he/she can quickly go check it out. <G>
  255. # ┌──────────────────────────────────────┐
  256. # │ P A T H   C H E C K   W A R N I N G  │
  257. # └──────────────────────────────────────┘
  258.   exec "command /c echo mh%a whas added a One-Liner! >> c:\sbbs\data\msgs\0001.msg"
  259.   crlf
  260.   crlf
  261.  
  262. # Adding Visual Dynamics for User pleasure.  <Chuckle>
  263.   print "rhSaving Post, ., ., . wThanks for postingy @USER@!
  264.   crlf
  265.   crlf
  266.  
  267. # Incentive for users to post (Participate).  Free Credits.  :)
  268.   print "cAdding m25 k ccredits to your account."
  269.   crlf
  270.   crlf
  271.   pause
  272.   adjust_user_credits 25
  273.   cmd_pop
  274.   goto top
  275. # End Cmdkey Y
  276. end_cmd
  277.  
  278. # Darn, they changed their mind.  Don't Add Post, go back to top of menu.
  279. cmdkey N
  280.   cmd_pop
  281.   goto top
  282. end_cmd
  283.  
  284. # FALL THROUGH (Just in case...)
  285. cmd_pop
  286. goto top
  287.  
  288. # Exit Script
  289. :byebye
  290.